Deadlocks pt 1

 

use ReportBuilderTraining

update Address set Street1 = '1 Main St' where StudentId=1
update Phone set Local='507-555-1234' where StudentId=1

go


Begin Transaction

-- #1

update Address
	set Street1 = '274 Wood St'
	where StudentId=1


-- #3

update Phone
	set Local='555-555-5555'
	where StudentId=1

commit transaction

select * from Address where StudentId=1
select * from Phone where StudentId=1